/*
 * @Author: your name
 * @Date: 2022-03-16 15:13:03
 * @LastEditTime: 2022-03-22 21:10:16
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \blog-system-front\src\Pages\Article\article_caterory\FilterForn.js
 */
/*
 * @Author: your name
 * @Date: 2022-03-10 20:34:43
 * @LastEditTime: 2022-03-14 17:01:53
 * @LastEditors: LAPTOP-L472H14P
 * @Description: In User Settings Edit
 * @FilePath: \blog-system-front\src\Pages\Article\SearchList.js
 */
import React, { useState } from "react";
import { Form, Row, Col, Input, Button, Select } from "antd";
const { Option } = Select;
export default function FilterForn(props) {
  const [form] = Form.useForm();
  const [expand, setExpand] = useState(false);
  const { initData } = props;
  const getFields = () => {
    const count = expand ? 10 : 6;
    const children = [
      <Col span={8} key="category_name">
        <Form.Item name="category_name" label="标签名称">
          <Input />
        </Form.Item>
      </Col>,
    ];
    return children;
  };
  const onFinish = (values) => {
    initData(values);
  };

  return (
    <Form
      form={form}
      name="advanced_search"
      className="ant-advanced-search-form"
      onFinish={onFinish}
      style={{marginBottom: 10}}
    >
      <Row gutter={24}>{getFields()}</Row>
      <Row>
        <Col span={24} style={{ textAlign: "right" }}>
          <Button type="primary" htmlType="submit">
            查询
          </Button>
          <Button
            style={{ margin: "0 8px" }}
            onClick={() => {
              form.resetFields();
            }}
          >
            重置
          </Button>
        </Col>
      </Row>
    </Form>
  );
}
